
'use strict';
// 文档管理
module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { INTEGER, STRING, DATE, ENUM } = Sequelize;
    // 创建表
    await queryInterface.createTable('file', {
      id: {
        type: INTEGER(30).UNSIGNED,
        primaryKey: true,
        autoIncrement: true
      },
      type: {
        type: STRING(200),
        allowNull: false,
        defaultValue: '',
        comment: '类型',
      },
      title:{
        type: STRING(200),
        allowNull: false,
        defaultValue: '',
        comment: '标题',
      },
      content: {
        type: STRING(5000),
        allowNull: false,
        defaultValue: '',
        comment: '内容',
      },
      order:{
        type: INTEGER(30),
        allowNull: false,
        defaultValue: 1,
        comment: '排序',
      },
      created_at: DATE,
      updated_at: DATE,
    });
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.dropTable('file');
  }
};